package com.pocketpets.main;

import android.app.ProgressDialog;
import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.view.View;
import android.widget.TabHost;

import com.app.pocketpets.R;
import com.pocketpets.ui.map.Map;

public class PocketPets extends TabActivity {

	// ================================================================
	// Inheried methods
	// ================================================================

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
		// requestWindowFeature(Window.FEATURE_NO_TITLE);

		Resources res = getResources(); // Resource object to get Drawables
		TabHost tabHost = getTabHost(); // The activity TabHost
		TabHost.TabSpec spec; // Resusable TabSpec for each tab
		Intent intent; // Reusable Intent for each tab

		// Create an Intent to launch an Activity for the tab (to be reused)
		intent = new Intent().setClass(this, Home.class);

		// Initialize a TabSpec for each tab and add it to the TabHost
		spec = tabHost.newTabSpec("Home")
				.setIndicator("Home", res.getDrawable(R.drawable.home))
				.setContent(intent);
		tabHost.addTab(spec);

		// Do the same for the other tabs
		intent = new Intent().setClass(this, Map.class);
		spec = tabHost.newTabSpec("Map")
				.setIndicator("Map", res.getDrawable(R.drawable.radar_32))
				.setContent(intent);
		tabHost.addTab(spec);

		intent = new Intent().setClass(this, CaughtPets.class);
		spec = tabHost
				.newTabSpec("Collection")
				.setIndicator("Collection",
						res.getDrawable(R.drawable.collection))
				.setContent(intent);
		tabHost.addTab(spec);

		intent = new Intent().setClass(this, AllPets.class);
		spec = tabHost.newTabSpec("All")
				.setIndicator("All", res.getDrawable(R.drawable.search))
				.setContent(intent);
		tabHost.addTab(spec);
		tabHost.setCurrentTab(0);
	}

}